#include "defs.h"
#include "matriz.h"
#include "sistemas.h"


int main(){
	int n = 3;
	
	Matriz M(n, Vector(n,0));
	M[0][0] = 1;
	M[0][1] = 2;
	M[0][2] = 2;
	M[1][0] = 1;
	M[1][1] = 1;	
	M[1][2] = 5;
	M[2][0] = 2;
	M[2][1] = 2;
	M[2][2] = 5;
	
	Vector d(n,0);
	d[0] = 2;
	d[1] = 3;
	d[2] = 1;
	
	Vector disparo1(n);		
	solvePLUPivEsc(M, d, disparo1, n);
	for(int i=0;i<n;++i){
		cout << disparo1[i] << endl;
	}
	cout << endl;
	Vector disparo2(n);		
	solvePLU(M, d, disparo2, n);
	for(int i=0;i<n;++i){
		cout << disparo2[i] << endl;
	}
	
	cout << endl;
	Vector disparo3(n);
	solveQR(M, d, disparo3, n);		
	for(int i=0;i<n;++i){
		cout << disparo3[i] << endl;
	}
	
	return 0;
}
